#ifndef __DRV_LCD_H__
#define __DRV_LCD_H__

#include "../common_typedef.h"

#define LCD_W 240
#define LCD_H 240

// POINT_COLOR
#define WHITE 0xFFFF
#define BLACK 0x0000
#define BLUE 0x001F
#define BRED 0XF81F
#define GRED 0XFFE0
#define GBLUE 0X07FF
#define RED 0xF800
#define MAGENTA 0xF81F
#define GREEN 0x07E0
#define CYAN 0x7FFF
#define YELLOW 0xFFE0
#define BROWN 0XBC40
#define BRRED 0XFC07
#define GRAY 0X8430
#define GRAY175 0XAD75
#define GRAY151 0X94B2
#define GRAY187 0XBDD7
#define GRAY240 0XF79E

void LcdSt7789Clear(const struct LcdSt7789* lcd, uint16_t color);
void LcdSt7789Init(struct LcdSt7789* lcd);
void LcdSt7789AddressConfig(const struct LcdSt7789* lcd, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
void LcdSt7789SyncRam(const struct LcdSt7789* lcd, int x1, int y1, int x2, int y2, uint16_t* pRam);

void lcd_set_color(uint16_t back, uint16_t fore);
void LCD_DrawRadomPoint(const struct LcdSt7789* lcd, int x, int y, uint16_t color);
void lcd_Fill(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color);

void LCD_InitGram(const struct LcdSt7789* lcd);
void LCD_DrawGramPoint(int x, int y, uint16_t color);
void LCD_SyncGram(void);
void LCD_ClrGram(void);
uint32_t LCD_GetFrameTime(void);

#endif
